import { createRouter, createWebHistory } from 'vue-router'
import Home from "../views/Home";
import Login from "../views/Login";
import Register from "../views/Register";
import Settings from "../views/Settings.vue"
import Learning from '../views/Leaning.vue'
import Today from '../views/Today.vue'
import Chat from '../views/Chat.vue'
import Story from '../views/Story.vue'
import EnglishChat from '../views/EnglishChat.vue'
import learn1 from '../views/Learning1.vue'
import review1 from '../views/Review1.vue'
import WordDetail from '../views/WordDetail.vue'
import AILearningAnalysis from '../views/AILearningAnalysis.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      // 页面标题title
      title: 'WordTree'
    }

  },
  {
    path: "/login",
    name: 'Login',
    component: Login,
    meta: {
      // 页面标题title
      title: '登录 - WordTree'
    }
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
    meta: {
      // 页面标题title
      title: '注册 - WordTree'
    }
  },
  {
    path: "/settings",
    name: 'Settings',
    component: Settings,
    meta: {
      // 页面标题title
      title: '个人设置 - WordTree'
    }
  },
  {
    path: "/learning",
    name: 'Learning',
    component: Learning,
    meta: {
      // 页面标题title
      title: '记忆 - WordTree'
    }
  },
  {
    path: "/today",
    name: 'Today',
    component: Today,
    meta: {
      // 页面标题title
      title: '今日单词 - 词境星云'
    }
  },
  {
    path: "/chat",
    name: 'Chat',
    component: Chat,
    meta: {
      // 页面标题title
      title: '聊天 - 词境星云'
    }
  },  {
    path: "/story",
    name: 'Story',
    component: Story,
    meta: {
      // 页面标题title
      title: '故事 - 词境星云'
    }
  },
  {
    path: "/english-chat",
    name: 'EnglishChat',
    component: EnglishChat,
    meta: {
      // 页面标题title
      title: '英语对话 - 词境星云'
    }
  },
  {
     path: '/generated-stories',
     name: 'GeneratedStories',
     component: () => import('@/views/GeneratedStories.vue')
  },
  {
    path: "/learn1",
    name: 'learn1',
    component: learn1,
    meta: {
      // 页面标题title
      title: '学习-测试 - 词境星云'
    }
  },  {
    path: "/review1",
    name: 'review1',
    component: review1,
    meta: {
      // 页面标题title
      title: '复习-测试 - 词境星云'
    }
  },
  {
    path: "/word/:word",
    name: 'WordDetail',
    component: WordDetail,
    meta: {
      // 页面标题title
      title: '单词详情 - 词境星云'
    }
  },
    {
    path: "/fast-story",
    name: 'FastStory',
    component: () => import('@/views/FastStory.vue'),
    meta: {
      title: '快速故事 - 词境星云'
    }
  },
  
  {
    path: "/ai-analysis",
    name: 'AILearningAnalysis',
    component: AILearningAnalysis,
    meta: {
      title: 'AI学习分析 - 词境星云'
    }
  },
  
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
